<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    console.log(Math.round(3.501));
    console.log(Math.ceil(3.1));
    console.log(Math.floor(3.9));
    // 获取随机数
    console.log(Math.random());
    // 产生 1 - 10 的随机数
    console.log(Math.floor(Math.random() * 10 + 1));
</script>
</body>
</html>